//
// Created by jsjxsy on 2022/9/1.
//vector嵌套
//
#include <vector>
#include <iostream>
using namespace std;
//
// Created by jsjxsy on 2022/9/1.
// 静态数组
//
#include <vector>
#include <iostream>
using namespace std;
void test01() {
  vector<int> v;

  //预留空间
//  v.reserve(100000);

  int num = 0;
  int *p = NULL;
  for (int i = 0; i < 100000; i++) {
    v.push_back(i);
    if (p != &v[0]) {
      p = &v[0];
      num++;
    }
  }

  cout << "num:" << num << endl;
}
int main() {
  test01();
  return 0;
}

